
import { useState } from 'react';
import Sidebar from '@/components/Layout/Sidebar';
import AudioCollection from '@/components/Modules/AudioCollection';
import SignalProcessing from '@/components/Modules/SignalProcessing';
import FeatureExtraction from '@/components/Modules/FeatureExtraction';
import SoundLocalization from '@/components/Modules/SoundLocalization';
import ModelTraining from '@/components/Modules/ModelTraining';
import PerformanceAnalysis from '@/components/Modules/PerformanceAnalysis';
import UserManagement from '@/components/Modules/UserManagement';
import FeedbackManagement from '@/components/Modules/FeedbackManagement';
import SystemSettings from '@/components/Modules/SystemSettings';

const Index = () => {
  const [activeModule, setActiveModule] = useState('collection');

  const renderModule = () => {
    switch (activeModule) {
      case 'collection':
        return <AudioCollection />;
      case 'processing':
        return <SignalProcessing />;
      case 'extraction':
        return <FeatureExtraction />;
      case 'localization':
        return <SoundLocalization />;
      case 'training':
        return <ModelTraining />;
      case 'analysis':
        return <PerformanceAnalysis />;
      case 'users':
        return <UserManagement />;
      case 'feedback':
        return <FeedbackManagement />;
      case 'settings':
        return <SystemSettings />;
      default:
        return <AudioCollection />;
    }
  };

  return (
    <div className="min-h-screen flex bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900">
      <Sidebar activeModule={activeModule} onModuleChange={setActiveModule} />
      
      <main className="flex-1 p-8 overflow-y-auto">
        <div className="max-w-7xl mx-auto">
          {renderModule()}
        </div>
      </main>
    </div>
  );
};

export default Index;
